#ifndef _ACCOUNT_H_
#define _ACCOUNT_H_

#include <iostream>
#include <fstream>
#include <json/value.h>
#include <string>
#include <vector>
#include <json/json.h>

using namespace std;

class account{
private:
    string ID;
    string password;

public:
    account(string id,string pwd);
    string Getid() const;
    string Getpassword() const;
    void Setid(const string& id);
    void SetPassword(const string& pwd);
    Json::Value toJson() const;
    void fromJson(const Json::Value& jsondata);
};

class AccountManager
{
private:
    vector<account> accounts;
    string filename;
public:
    AccountManager(string filename);
    bool Add_account(const account& account);
    bool Del_account(const string& id);
    bool Modify_Password(const string& id,const string& password);
    void Save() const;
    void List() const;
    bool Verify(const string& id,const string& password);
private:
    void Load();
};


#endif